package com.my.swas.sso.module.admin.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.my.swas.sso.module.admin.entity.User;
import com.my.swas.sso.enums.OperationType;
import com.my.swas.sso.module.admin.dto.UserDto;
import com.my.swas.sso.module.admin.vo.UserVo;

import java.util.List;


/**
 * @Description:
 * @author: :MaYong
 */
public interface UserService extends IService<User> {

    /**
     * 分页查询
     *
     * @param userDto
     * @return
     */
    IPage<UserVo> pageList(UserDto userDto);

    /**
     * 更新验证次数
     *
     * @param record
     * @return
     */
    Integer updateVerifyCount(User record);

    /**
     * 组装带角色集合的用户集合
     *
     * @param userDto
     * @return
     */
    List<UserVo> getUserVoList(UserDto userDto);

    /**
     * 组装带角色集合的用户
     *
     * @param userId
     * @return
     */
    UserVo getUserVo(Long userId);

    /**
     * 给用户分配角色
     * @param userId
     * @param roleIds
     */
    void grantRoles(Long userId, String roleIds);

    /**
     * 错误次数累积
     * @param userId
     * @param verifyCount
     */
    void verifyCount(Long userId, Integer verifyCount, OperationType operationType);


}
